/**
 * 监控列表API
 *
 * @版权所有 rem.studio
 */
import request from '@/utils/request';
import { getParamsSuffix } from '@/utils/paramsUtils';

/**
 * 监控列表获取数据
 * @param query
 * @returns {Promise<any>}
 */
export async function listAllmonitroInfos(query) {
  const params = getParamsSuffix(query);
  return request(`/api/swservice/v1/sw/mi/listAllmonitroInfos?${params}`, {
    method: 'GET',
  });
}

/**
 * 新增监控列表信息
 * @param params
 * @returns {Promise<any>}
 */
export async function createNewMnitorinfo(params) {
  console.log(params)
  return request('/api/swservice/v1/sw/mi/createNewMnitorinfo', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}

/**
 * 删除监控列表信息
 * @param params
 * @returns {Promise<any>}
 */
export async function deleteById(params) {
  console.log(params)
  return request('/api/swservice/v1/sw/mi/delMnitorinfo', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}

/**
 * 更新监控列表信息
 * @param params
 * @returns {Promise<any>}
 */
export async function updateLockInfo(params) {
  return request('/api/swservice/v1/sw/mi/updateMnitorinfoInfo', {
    method: 'POST',
    requestType: 'form',
    data: { ...params },
  });
}

